#include "auth.h"

int authentification() {

    int enter=0;

 char password[5],username[10];
    char ch1[]="docteur",ch2[]="directeur";
    char mp1[]="10001",mp2[]="10002";

   int i=1;

     printf("\n\n\n********AUTHENTIFICATION********\n\n\n");
do{

printf("\nusername : ");
scanf("%s",username);
printf("\npassword <5 chiffre> : ");
scanf("%s",password);

if (((strcmp(username,ch1)==0) && (strcmp(mp1,password)==0))||((strcmp(username,ch2)==0) &&strcmp(mp2,password)==0))
    {

printf("Bienvenue au programme !!\n");
enter = 1;
break;

}
else{
printf("\nattention !!!!! il reste %d essais\n",3-i);
i++;
enter =0;
}
}while (i<=3);

if (i>3){
printf("Votre compte a ete bloquee \n");
}

return enter;



}

